﻿using System.Collections.Generic;
using System.Data.Common;

namespace Songhay.Data.GenericWeb.Procedures
{
    using Songhay.Data.GenericWeb.Properties;

    /// <summary>
    /// List procedures into the DBMS.
    /// </summary>
    public static partial class List
    {
        /// <summary>
        /// Lists all Document data in the DBMS catalogue.
        /// </summary>
        /// <param name="commonConnection">The Common connection.</param>
        /// <returns>Returns an XML <see cref="System.String"/>.</returns>
        public static string Documents(DbConnection commonConnection)
        {
            return List.Documents(commonConnection, false);
        }

        /// <summary>
        /// Lists all Document data in the DBMS catalogue.
        /// </summary>
        /// <param name="commonConnection">The Common connection.</param>
        /// <param name="returnXmlForEmptySet">When <c>true</c> <see cref="Songhay.Xml.XmlUtility.GetInternalMessage(string,string[])"/> is used for empty sets.</param>
        /// <returns>Returns an XML <see cref="System.String"/>.</returns>
        public static string Documents(DbConnection commonConnection, bool returnXmlForEmptySet)
        {
            Dictionary<string, object> param = new Dictionary<string, object>(1);
            param.Add("@GlobalDateFormat", CommandHandler.GlobalDateFormat);
            string s = Common.CommonScalar.GetString(commonConnection, Resources.ListDocuments, param, returnXmlForEmptySet);

            return s;
        }
    }
}
